import java.util.Comparator;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: dings
 * Date: 2024-06-11
 * Time: 20:00
 */

class myArray2<E extends Comparable<E>> {//传入的参数只能是Number或者是Number的子类
    public Object[] array = new Object[10];

    public void setValue(int pos,E val) {
        array[pos] = val;
    }
    public E getValue(int pos) {
        return (E)array[pos];
    }

}
public class Test {
    public static void main(String[] args) {
        /*myArray<Integer> Array = new myArray<>();
        myArray<String> Array1 = new myArray<>();*/
    }
   /* public static void main(String[] args) {
        myArray<Integer> Array = new myArray<>();
        myArray<String> Array1 = new myArray<>();//传入的参数只能是Number或者是Number的子类
    }*/
    /*public static void main2(String[] args) {
        myArray Array = new myArray();
        Array.setValue(0,10);
        Integer a = (Integer) Array.getValue(0);
    }*/
    public static void main1(String[] args) {
       /* myArray<Integer> Array = new myArray<>();
        Array.setValue(0,10);//自动类型检查
        Array.setValue(1,100);//自动类型检查*/
        //Array.setValue(2,"dings");////自动类型检查 发现错误
        //Integer ret1 = Array.getValue(0);//自动类型转换
        //System.out.println(ret1);
    }
}

/*
 public static void main3(String[] args) {
        Integer a = 100;
        Integer b = 100;
        System.out.println(a==b);

        Integer c = 200;
        Integer d = 200;
        System.out.println(c==d);
    }
    public static void main2(String[] args) {
        Integer a = 10;//自动装箱（先装好箱,再来拆箱）
        int a1 = a;//自动拆箱

        int a2 = a.intValue();//手动拆箱
        double a3 = a.doubleValue();//手动拆箱
    }
    public static void main1(String[] args) {
        Integer a = 10;//自动装箱

        int b = 10;
        Integer c = Integer.valueOf(b);//显示装箱
    }
 */